﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="Web.Admin.Page_Module.List" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>

<!DOCTYPE html>

<%="<!--[if IE 8]> <html class=\"ie8 no-js\"> <![endif]-->"%>
<%="<!--[if IE 9]> <html class=\"ie9 no-js\"> <![endif]-->"%>
<%="<!--[if !IE]><!-->"%>
<html>
<%="<!--<![endif]-->"%>
    <!-- BEGIN HEAD -->

    <head>
        <meta charset="utf-8" />
        <title><%=Evan.Common.CommFun.GetAppSetting("AdminTitle") %> - 模块管理系统</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta content="width=device-width, initial-scale=1" name="viewport" />
        <!-- #include file="../include/com_res_css.inc" -->
    </head>
    <!-- END HEAD -->

    <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
        <!-- BEGIN HEADER -->
        
        <!-- #include file="../include/top_bar.inc" -->

        <!-- END HEADER -->
        <!-- BEGIN HEADER & CONTENT DIVIDER -->
        <div class="clearfix"> </div>
        <!-- END HEADER & CONTENT DIVIDER -->
        <!-- BEGIN CONTAINER -->
        <div class="page-container">
            <!-- BEGIN SIDEBAR -->
            
            <!-- #include file="../include/left_menu.inc" -->
            
            <!-- END SIDEBAR -->
            <!-- BEGIN CONTENT -->
            <div class="page-content-wrapper">
                <!-- BEGIN CONTENT BODY -->
                <div class="page-content">
                    <!-- BEGIN PAGE HEADER-->
                    <!-- BEGIN THEME PANEL -->
                    <!-- #include file="../include/theme_panel.inc" -->
                    <!-- END THEME PANEL -->
                    <!-- BEGIN PAGE BAR -->
                    <div class="page-bar hide">
                        <ul class="page-breadcrumb">
                            <li>
                                <a href="index.html">Home</a>
                                <i class="fa fa-circle"></i>
                            </li>
                            <li>
                                <span>UI Features</span>
                            </li>
                        </ul>
                        <div class="page-toolbar">
                            <div class="btn-group pull-right">
                                <button type="button" class="btn green btn-sm btn-outline dropdown-toggle" data-toggle="dropdown"> Actions
                                    <i class="fa fa-angle-down"></i>
                                </button>
                                <ul class="dropdown-menu pull-right" role="menu">
                                    <li>
                                        <a href="#">
                                            <i class="icon-bell"></i> Action</a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="icon-shield"></i> Another action</a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="icon-user"></i> Something else here</a>
                                    </li>
                                    <li class="divider"> </li>
                                    <li>
                                        <a href="#">
                                            <i class="icon-bag"></i> Separated link</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!-- END PAGE BAR -->
                    <!-- BEGIN PAGE TITLE-->
                    <h3 class="page-title" style="margin-top:0px;"> 模块列表</h3>
                    <!-- END PAGE TITLE-->
                    <!-- END PAGE HEADER-->
                    <!-- BEGIN PAGE CONTENT-->

                                    <div class="table-scrollable">
                                        <table class="table table-striped table-bordered table-hover">
                                            <thead>
                                                <tr>
                                                    <th scope="col" class="manager_tab_center">选择</th>
                                                    <th scope="col">模块名称</th>
                                                    <th scope="col" class="manager_tab_center">排序</th>
                                                    <th scope="col" class="manager_tab_center">添加时间</th>
                                                    <th scope="col" class="manager_tab_center">锁定</th>
                                                    <th scope="col" class="manager_tab_center">操作</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <% foreach (var item in List.Item) { %>
                                                <tr>
                                                    <td class="manager_tab_check"> 
                                                            <label class="mt-checkbox mt-checkbox-outline">
                                                                <input type="checkbox" class="check-one" id="check-<%=item.Id %>"  data-id="<%=item.Id %>" />
                                                                <span></span>
                                                            </label>
                                                        </td>
                                                    <td><a onclick="EditClick(<%=item.Id %>)" href="javascript:;"><%=item.Title %></a></td>
                                                            
                                                    
                                                    
                                                    <th class="manager_tab_center"><input type="text" class="sortid_field" data-id="<%=item.Id %>" value="<%=item.SortId %>" /></th>
                                                    <td class="manager_tab_center"><%=item.AddTime.ToString("yyyy-MM-dd hh:mm:ss") %></td>
                                                    <td class="manager_tab_center">
                                                        <a href="javascript:;" class="btn btn-xs <%=(item.States==0?"red":"default") %> states" data-tip-type="模块" data-id="<%=item.Id %>" data-title="<%=item.Title %>" data-states="<%=item.States %>"> 锁定 <i class="fa fa-lock"></i></a>
                                                    </td>
                                                    <td class="manager_tab_center">
                                                        <div class="btn-group btn-group-xs btn-group-solid">
                                                            <button type="button" class="btn green" onclick="EditClick(<%=item.Id %>)">编辑</button>
                                                            <button type="button" class="btn red del" data-tip-type="内容" data-id="<%=item.Id %>" data-title="<%=item.Title %>">删除</button>
                                                        </div> 
                                                    </td>
                                                </tr>
                                        <% } %>


                              
                                                
                                            </tbody>
                                        </table>
                                    </div>

                            <div class="clearfix">
                                <div class="btn-toolbar pull-right pagebar"></div>
                            </div>
                    <!-- END PAGE CONTENT-->
                </div>
                <!-- END CONTENT BODY -->
            </div>
            <!-- END CONTENT -->
            
        </div>
        <!-- END CONTAINER -->
        <!-- #include file="../include/footer.inc" -->
   <!-- #include file="../include/com_res_js.inc" -->
    </body>
    <script type="text/javascript">
        $(function () {
            
            <%--laypage({
                cont: $(".pagebar"),
                pages: <%=List.PageCount%>, //可以叫服务端把总页数放在某一个隐藏域，再获取。假设我们获取到的是18
                skip: false, //是否开启跳页
                groups: 10,
                //hash: 'fenye',
                curr: function () { //通过url获取当前页，也可以同上（pages）方式获取
                    var page = location.search.match(/page=(\d+)/);
                    return page ? page[1] : 1;
                }(),
                jump: function (e, first) { //触发分页后的回调
                    if (!first) { //一定要加此判断，否则初始时会无限刷新
                        JumpPage(e.curr)
                        //location.href = '?page=' + e.curr;
                    }
                }
            });--%>

            layui.laypage.render({
                elem: $(".pagebar"),
                count: <%=List.AllCount%>, //数据总数，从服务端得到
                limit: <%= PageSize %>,
                groups: 10,
                curr: function () { //通过url获取当前页，也可以同上（pages）方式获取
                    var page = location.search.match(/page=(\d+)/);
                    return page ? page[1] : 1;
                }(),
                prev: "上一页",
                next: "下一页",
                layout: ['count', 'prev', 'page', 'next'],
                jump: function (obj, first) {
                    //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                    //console.log(obj.limit); //得到每页显示的条数
                    if (!first) { //一定要加此判断，否则初始时会无限刷新
                        JumpPage(e.curr);
                    }
                }
            });

        });
    </script>
</html>
